{% extends "buyer/base.html" %}

{% block title %}
    用户订单
{% endblock %}

{% block content %}
	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/Buyer/user_info/">· 个人信息</a></li>
				<li><a href="/Buyer/uco/" class="active">· 全部订单</a></li>
				<li><a href="user_center_site.html">· 收货地址</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
				<h3 class="common_title2">全部订单</h3>
                {% for order in order_list %}
				<ul class="order_list_th w978 clearfix">
					<li class="col01">{{ order.order_data }}</li>
					<li class="col02">订单号：{{ order.order_number }}</li>
                    {% ifequal order.order_status 0 %}
					    <li class="col02 stress">未支付</li>
                    {% endifequal %}
                    {% ifequal order.order_status 1 %}
					    <li class="col02 stress">已支付</li>
                    {% endifequal %}
                    {% ifequal order.order_status 2 %}
					    <li class="col02 stress">代发货</li>
                    {% endifequal %}
                    {% ifequal order.order_status 3 %}
					    <li class="col02 stress">待收货</li>
                    {% endifequal %}
                    {% ifequal order.order_status 4 %}
					    <li class="col02 stress">完成</li>
                    {% endifequal %}

				</ul>

				<table class="order_list_table w980">
					<tbody>
						<tr>
							<td width="55%">
                                {% for o in order.orderinfo_set.all %}
								<ul class="order_goods_list clearfix">
									<li class="col01"><img src="/static/{{ o.goods_picture }}"></li>
									<li class="col02">{{ o.goods_name }}<em>{{ o.goods_price }}元/500g</em></li>
									<li class="col03">{{ o.goods_count }}</li>
                                    <li class="col03">
                                        {% ifequal o.order_status 0 %}
                                            未支付
                                        {% endifequal %}
                                        {% ifequal o.order_status 1 %}
                                            已支付
                                        {% endifequal %}
                                        {% ifequal o.order_status 2 %}
                                            代发货
                                        {% endifequal %}
                                        {% ifequal o.order_status 3 %}
                                            待收货
                                        {% endifequal %}
                                        {% ifequal o.order_status 4 %}
                                            完成
                                        {% endifequal %}
                                    </li>
									<li class="col04">{{ o.goods_total_price }}元</li>
								</ul>
                                {% endfor %}
							</td>
							<td width="15%">{{ order.order_total }}元</td>



                            {% ifequal order.order_status 0 %}
                                <td width="15%"><a href="/Buyer/alipay/?order_number={{ order.order_number }}&total={{ order.order_total }}" class="oper_btn">去付款</a></td>
                            {% else %}
                                <td width="15%"><a href="#" class="oper_btn">查看详情</a></td>
                            {% endifequal %}
						</tr>
					</tbody>
				</table>
                {% endfor %}
				<div class="pagenation">
					<a href="#"><上一页</a>
					<a href="#" class="active">1</a>
					<a href="#">2</a>
					<a href="#">3</a>
					<a href="#">4</a>
					<a href="#">5</a>
					<a href="#">下一页></a>
				</div>
		</div>
	</div>
{% endblock %}